import React, {useContext} from "react";
import {DatasetContext} from "./context";
import {Dialog} from "rc-easyui";
import FormPanel from "./form";

const FormDialog = ({ value, props, close }) => {
    const { ctx, pageConfig, fetchConfig, refs, buckets } = useContext(DatasetContext)
    return (
        <Dialog title={props.title} bodyCls="f-column" modal closed={true} ref={value.ref}>
            <FormPanel className="f-full" ctx={ctx} pageConfig={pageConfig} fetchConfig={fetchConfig} {...props} close={close} refs={refs} buckets={buckets} />
        </Dialog>
    )
}

export {
    FormDialog
}